#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
    int n = 0;
    scanf("%d", &n);
    struct student
    {
        char number[6];
        char name[10];
        int score;
    };

    struct student stu[10];
    int i = 0;
    for (i = 0; i < n; i++)
    {
        scanf("%s", &stu[i].number);
        scanf("%s", &stu[i].name);
        scanf("%d", &stu[i].score);
    }

    double sum = 0;
    double aver = 0;
    for (i = 0; i < n; i++)
    {
        sum += stu[i].score;
    }
    aver = sum / n;
    printf("%.2lf\n", aver);


    for (i = 0; i < n; i++)
    {
        if (stu[i].score < aver)
        {
            printf("%s ", stu[i].name);
            printf("%s\n", stu[i].number);
        }
    }
    return 0;

}